package com.smarttest.portal.service.impl;

import java.util.List;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.smarttest.portal.mapper.TestMapper;
import com.smarttest.portal.pojo.Test;
import com.smarttest.portal.pojo.TestExample;
import com.smarttest.portal.pojo.TestExample.Criteria;
import com.smarttest.portal.service.TestService;

@Service
public class TestServiceImpl implements TestService{
    @Autowired
	private TestMapper testMapper;
	@Override
	public Test getTestById(int id) {
		// TODO Auto-generated method stub
		TestExample example = new TestExample();
		Criteria criteria = example.createCriteria();
		criteria.andIdEqualTo(id);
		List<Test> list = testMapper.selectByExample(example);
		if(list!=null&&list.size()>0){
			Test test = list.get(0);
			return test;
		}
		return null;
	}
}
